<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>event.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
	<script type="text/javascript">
		//  控制页面所有的图片宽度都不超过400像素
		var imgs = document.images;
		for(var i=0;i<imgs.length;i++)
		{
			if(imgs[i].offsetWidth>400)
			{
				var ht = imgs[i].offsetHeight*490/imgs[i].offsetWidth;
				imgs[i].style.height = ht + "px";
				imgs[i].style.width = "490px"
				alert(od);
			}
		}	
		function imgClick(img)
		{
			alert(img.src);
		}
	</script>
	
  </head>
  
  <body>
  <script type="text/javascript">
		function newPicWindow()
		{
			window.open(this.src);
		}
		for(var i=0;i<document.images.length;i++)
		{
			document.images[i].onclick = newPicWindow;
		}
	</script>
    <!--  <img src="../image/b1204.jpg" onclick="alert(this.src)" /> this指对象本身的引用,指<img>标记本身表示的img对象 -->
     <img src="../image/b1204.jpg" onClick = "imgClick(this)" /><!-- this只能在onClick中使用 -->
  </body>
</html>
